package top.misspro.valheim.model;

import lombok.Getter;

import java.util.ArrayList;

/**
 * @author Evan
 */
@Getter
public class CommandResultModel {
    private String status;
    private ArrayList<String> data;
    private String message;

    private CommandResultModel() {

    }

    public static CommandResultModel runningResult(ArrayList<String> list) {
        CommandResultModel resultModel = new CommandResultModel();
        resultModel.status = "running";
        resultModel.data = list;
        return resultModel;
    }

    public static CommandResultModel done(ArrayList<String> list) {
        CommandResultModel resultModel = new CommandResultModel();
        resultModel.status = "done";
        resultModel.data = list;
        return resultModel;
    }

    public static CommandResultModel abnormal() {
        CommandResultModel resultModel = new CommandResultModel();
        resultModel.status = "abnormal";
        resultModel.data = null;
        resultModel.message = "不存在此服务器运行状态！请等候或检查服务器状态再次操作！";
        return resultModel;
    }

    public static CommandResultModel ready() {
        CommandResultModel resultModel = new CommandResultModel();
        resultModel.status = "ready";
        resultModel.message = "已提交命令，请等待执行结果！";
        return resultModel;
    }
}
